<template>
  <div class="app">
    <div>
      <div class="shuru">
        <input type="text" placeholder="搜索商品" /><van-icon name="chat-o" />
      </div>
      <div class="zhao">
        <img
          src="https://x.dscmall.cn/storage/data/store_street/street_thumb/1490153973561051484.jpg"
          alt=""
        />
      </div>
      <div class="shopname" >
        <div class="imga">
          <img
            src="https://x.dscmall.cn/storage/images/seller_imgs/seller_logo/logo_thumb/1536872208964241423.jpg"
            alt=""
          />
        </div>
        <p>已有人关注</p>
        <ul>
          <li>全部：8</li>
          <li>新品：0</li>
          <li>促销：0</li>
        </ul>
        <div class="imgc">
            <img src="" alt="">
        </div>
        <div class="imgd"></div>
      </div>
    </div>
    <div class="commodity">
        <div  class="productdetails" v-for="value in puPop" v-bind:key="value.cat_id">
        <!-- <div  class="productdetails"> -->
            <div class="imgb">
                <img v-bind:src="value.goods_thumb"></div>
            <div class="xiang">
            <h4>
                 {{value.goods_name}}
            </h4>
            <p>
                库存：299 &emsp; 销量：1
            </p>
            <div class="price">
                <div class="money">
                    3188.00
                </div>
            </div>
            </div>
        </div>
    </div>
  </div>
</template>

<style lang="less" scoped>
.app {
  div {
     
    .shuru {
      float: left;
      width: 100%;
      margin-top: 10px;
      input {
        float: left;
        padding-left: 20px;
        box-sizing: border-box;
        margin-left: 1rem;
        height: 30px;
        width: 85%;
        border-radius: 20px;
        border: none;
        margin-right: 10px;
      }
      .van-icon-chat-o {
        font-size: 28px;
        color: #fff;
      }
    }
    .zhao {
      width: 100%;
      height: 200px;
      overflow: hidden;
      position: relative;
      top: -40px;
      z-index: -9;
      // transform: translateY(-130px);
      //   transition: all 5s linear 0s;
     
      img {
        width: 100%;
        position: absolute;
         @keyframes yidong {
        0% {
          transform: translateY(0);
        }
        50% {
          transform: translateY(-130px);
        }
        100% {
          transform: translateY(0px);
        }
      }
animation: yidong 20s linear infinite;
      
      }
    }
    .shopname {
      width: 100%;
      position: relative;
      top: -90px;
      left: 0px;
      background: #fff;
     padding-top: 20px;
      .imga {
        width: 60px;
        height: 60px;
        border-radius: 60px;
        box-shadow: 0px 0px 4px 3px #ccc;
        position: absolute;
        top: -30px;
        left: 156px;
        img {
          width: 100%;
          border-radius: 60px;
        }
      }
      p{
          text-align: center;
          margin: 30px 0 0 0;
          font-size: 14px;
      }
      ul{
          display: flex;
          justify-content: space-around;
          font-size: 14px;
          padding: 10px 0;
          
      }
    }
  }
  .commodity{
      width: 100%;
      position: relative;
      top: -90px;
      left: 0px;
      background: #F4F4F4;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-around;
      .productdetails{
          margin-top: 10px;
          width: 178px;
          height:292px ;
          background: #fff;
          padding: 12.8px;
          box-sizing: border-box;
          .imgb{
              width: 152px;
              height: 152px;
              img{
                  width: 100%;
              }
          }
          .xiang{
              margin-top: 10px;
              h4{
              margin: 0;
              display: -webkit-box;
                -webkit-box-orient: vertical;
                overflow: hidden;
                text-overflow: ellipsis;
                -webkit-line-clamp: 2;
                font-weight: 400;
                font-size: 1.4rem;
              
          }
          p{
              margin: 0.4rem 0 0 0;
              font-size: 1.3rem;
              color: #888;
          }
          .price{
              margin-top: 10px;
              .money{
                  
                  font-size: 18px;
                  color: rgb(242, 14, 40);
                  font-weight: 700;
              }
          }
          }
      }
  }
}
</style>

<script>
export default {
 setup(){
     
 },
 mounted() {
    this.$store
      .dispatch({
        type: "setPupopr",
      })
      .then((data) => {});
    this.$store
      .dispatch({
        type: "setEnterstorer",
      })
      .then((data) => {});
  },
  computed: {
    puPop() {
      console.log(this.$store.state.shop.setPupop);
      return this.$store.state.shop.setPupop;
    },
    enterStore() {
      console.log(this.$store.state.shop.setEnterstore);
      return this.$store.state.shop.setEnterstore;
    },
  },

    
};
</script>